<html lang="en">
<head>
<title>Installing GCC: Testing</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Installing GCC: Testing">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.

   Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, the Front-Cover texts being (a) (see below), and
with the Back-Cover Texts being (b) (see below).  A copy of the
license is included in the section entitled "GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

     A GNU Manual

(b) The FSF's Back-Cover Text is:

     You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc { font-variant:small-caps }
  span.roman { font-family: serif; font-weight: normal; } 
--></style>
</head>
<body>
<h1 class="settitle">Installing GCC: Testing</h1>
<a name="index-Testing-1"></a><a name="index-Installing-GCC_003a-Testing-2"></a><a name="index-Testsuite-3"></a>
Before you install GCC, we encourage you to run the testsuites and to
compare your results with results from a similar configuration that have
been submitted to the
<a href="http://gcc.gnu.org/ml/gcc-testresults/">gcc-testresults mailing list</a>. 
Some of these archived results are linked from the build status lists
at <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>, although not everyone who
reports a successful build runs the testsuites and submits the results. 
This step is optional and may require you to download additional software,
but it can give you confidence in your new GCC installation or point out
problems before you install and start using your new GCC.

   <p>First, you must have <a href="download.html">downloaded the testsuites</a>. 
These are part of the full distribution, but if you downloaded the
&ldquo;core&rdquo; compiler plus any front ends, you must download the testsuites
separately.

   <p>Second, you must have the testing tools installed.  This includes
<a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a> 1.4.1 or 1.4.3
and later, Tcl, and Expect; the DejaGnu site has links to these.

   <p>If the directories where <span class="command">runtest</span> and <span class="command">expect</span> were
installed are not in the <span class="env">PATH</span>, you may need to set the following
environment variables appropriately, as in the following example (which
assumes that DejaGnu has been installed under <span class="file">/usr/local</span>):

<pre class="example">          TCL_LIBRARY = /usr/local/share/tcl8.0
          DEJAGNULIBS = /usr/local/share/dejagnu
</pre>
   <p>(On systems such as Cygwin, these paths are required to be actual
paths, not mounts or links; presumably this is due to some lack of
portability in the DejaGnu code.)

   <p>Finally, you can run the testsuite (which may take a long time):
<pre class="example">          cd <var>objdir</var>; make -k check
</pre>
   <p>This will test various components of GCC, such as compiler
front ends and runtime libraries.  While running the testsuite, DejaGnu
might emit some harmless messages resembling
<span class="samp">WARNING: Couldn't find the global config file.</span> or
<span class="samp">WARNING: Couldn't find tool init file</span> that can be ignored.

<h3 class="section"><a name="TOC0"></a>0.1 How can I run the test suite on selected tests?</h3>

<p>In order to run sets of tests selectively, there are targets
<span class="samp">make check-gcc</span> and <span class="samp">make check-g++</span>
in the <span class="file">gcc</span> subdirectory of the object directory.  You can also
just run <span class="samp">make check</span> in a subdirectory of the object directory.

   <p>A more selective way to just run all <span class="command">gcc</span> execute tests in the
testsuite is to use

<pre class="example">         make check-gcc RUNTESTFLAGS="execute.exp <var>other-options</var>"
</pre>
   <p>Likewise, in order to run only the <span class="command">g++</span> &ldquo;old-deja&rdquo; tests in
the testsuite with filenames matching <span class="samp">9805*</span>, you would use

<pre class="example">         make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <var>other-options</var>"
</pre>
   <p>The <span class="file">*.exp</span> files are located in the testsuite directories of the GCC
source, the most important ones being <span class="file">compile.exp</span>,
<span class="file">execute.exp</span>, <span class="file">dg.exp</span> and <span class="file">old-deja.exp</span>. 
To get a list of the possible <span class="file">*.exp</span> files, pipe the
output of <span class="samp">make check</span> into a file and look at the
<span class="samp">Running ...  .exp</span> lines.

   <p>The Java runtime tests can be executed via <span class="samp">make check</span>
in the <var>target</var><span class="file">/libjava/testsuite</span> directory in
the build tree.

<h3 class="section"><a name="TOC1"></a>0.2 Additional testing for Java Class Libraries</h3>

<p>The <a href="http://sources.redhat.com/mauve/">Mauve Project</a> provides
a suite of tests for the Java Class Libraries.  This suite can be run
as part of libgcj testing by placing the Mauve tree within the libjava
testsuite at <span class="file">libjava/testsuite/libjava.mauve/mauve</span>, or by
specifying the location of that tree when invoking <span class="samp">make</span>, as in
<span class="samp">make MAUVEDIR=~/mauve check</span>.

   <p><a href="http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html">Jacks</a>
is a free test suite that tests Java compiler front ends.  This suite
can be run as part of libgcj testing by placing the Jacks tree within
the libjava testsuite at <span class="file">libjava/testsuite/libjava.jacks/jacks</span>.

<h3 class="section"><a name="TOC2"></a>0.3 How to interpret test results</h3>

<p>The result of running the testsuite are various <span class="file">*.sum</span> and <span class="file">*.log</span>
files in the testsuite subdirectories.  The <span class="file">*.log</span> files contain a
detailed log of the compiler invocations and the corresponding
results, the <span class="file">*.sum</span> files summarize the results.  These summaries
contain status codes for all tests:

     <ul>
<li>PASS: the test passed as expected
<li>XPASS: the test unexpectedly passed
<li>FAIL: the test unexpectedly failed
<li>XFAIL: the test failed as expected
<li>UNSUPPORTED: the test is not supported on this platform
<li>ERROR: the testsuite detected an error
<li>WARNING: the testsuite detected a possible problem
</ul>

   <p>It is normal for some tests to report unexpected failures.  At the
current time our testing harness does not allow fine grained control
over whether or not a test is expected to fail.  We expect to fix this
problem in future releases.

<h3 class="section"><a name="TOC3"></a>0.4 Submitting test results</h3>

<p>If you want to report the results to the GCC project, use the
<span class="file">contrib/test_summary</span> shell script.  Start it in the <var>objdir</var> with

<pre class="example">         <var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
             -m gcc-testresults@gcc.gnu.org |sh
</pre>
   <p>This script uses the <span class="command">Mail</span> program to send the results, so
make sure it is in your <span class="env">PATH</span>.  The file <span class="file">your_commentary.txt</span> is
prepended to the testsuite summary and should contain any special
remarks you have on your results or your build environment.  Please
do not edit the testsuite result block or the subject line, as these
messages may be automatically processed.

   <p><hr />
<p><a href="./index.html">Return to the GCC Installation page</a>

<!-- ***Final install*********************************************************** -->
<!-- ***Binaries**************************************************************** -->
<!-- ***Specific**************************************************************** -->
<!-- ***Old documentation****************************************************** -->
<!-- ***GFDL******************************************************************** -->
<!-- *************************************************************************** -->
<!-- Part 6 The End of the Document -->
</body></html>

